package com.eastcom.bm.dataprocess.processor;

import com.eastcom.bm.dataprocess.processor.impl.AlarmProcessor;
import com.eastcom.bm.dataprocess.processor.impl.IntegerDataProcessor;
import com.eastcom.bm.dataprocess.processor.impl.RedirectProcessor;


public class ProcessorManager {
//  ~ Static fields/initializers ---------------------------------------------

    private static Processor[] p;

    //~ Methods ----------------------------------------------------------------

    /**
     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public synchronized static Processor[] getProcessors() {
    	try{
           if (p==null) {
            
               if(DataCollector.liveShow){
                  p=new Processor[2];             
                  p[0]=new RedirectProcessor();
                  p[1]=new AlarmProcessor();
            }else{
                 p=new Processor[2];             
                 p[0] = new RedirectProcessor();
                 p[1]=new IntegerDataProcessor();
            }               
            
           }     
    	}
    	catch(Exception e){
    		e.printStackTrace();
    	}
    	ProcessorManager.class.notify();
    	
        return p ;
    }
}
